/* 
 *  File: Room.java
 *  Author: Edson Pereira
 *  Version: 1.0
 *  Date: 02/10/2011
 *  
 *  Oracle Certified Master Java SE 6 Developer
 *  
 *  This class is part of Java Developer Assignment CX-310-252A_1
 */

package suncertify.domain;

/**
 * A Room object is a transfer value object that represents room information
 *
 * @author Edson Pereira
 * @version 1.0
 * @see Accommodation
 */
class Room {
    
    private static final String SEPARATOR = "; "; 

    /*
     *  Private members declaration
     */
    private boolean isSmoking;
    private int capacity;
    private long price;
    private String date;

    Room(int capacity, boolean smoking, long price, String date){
        this.capacity = capacity;
        this.isSmoking = smoking;
        this.price = price;
        this.date = date;
    }

    /**
     * Gets Room capacity
     * 
     * @return An {@int} with room capacity
     */
    public int getCapacity(){
        return this.capacity;
    }

    /**
     * Sets Room capacity
     * 
     * @param capacity Room capacity
     */
    public void setCapacity(int capacity){
        this.capacity = capacity;
    }

    /**
     * Gets Date when Room will be available to book
     * 
     * @return An {@String} with date in format yyyy-mm-dd
     */
    public String getDate(){
        return this.date;
    }

    /**
     * Sets Date when room will be available
     * 
     * @param date Date in format yyyy-mm-dd
     */
    public void setDate(String date){
        this.date = date;
    }

    /**
     * Gets Room status of smoking state
     * 
     * @return {@code true} is Room is smoking, false otherwise
     */
    public boolean isSmoking(){
        return this.isSmoking;
    }

    /**
     * Sets smoking state
     * 
     * @param smoking True if room is smoking
     */
    public void setSmoking(boolean smoking){
        this.isSmoking = smoking;
    }

    /**
     * Gets price for book Room
     * 
     * @return Value to book room
     */
    public long getPrice(){
        return this.price;
    }

    /**
     * Sets price to book Room
     * 
     * @param price Value to book Room
     */
    public void setPrice(long price){
        this.price = price;
    }
    
    /**
     * Returns A {@String} that representation of the Room class
     *
     * @return A {@String} that representation of the Room class
     */
    public String toString(){
        String roomString = this.capacity + SEPARATOR
                                + this.isSmoking + SEPARATOR
                                + this.price + SEPARATOR
                                + this.date;
        return roomString;
    }
}